package com.un.ebs.inventory.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.un.ebs.inventory.domain.InventoryAccount;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * (InventoryAccount)表数据库访问层
 *
 * @author liubo
 * @since 2020-09-14 09:53:29
 */
public interface InventoryAccountMapper extends BaseMapper<InventoryAccount> {

    @Select("select * from tb_inventory_account where sku_id = #{skuId} and account_year = #{year} and account_month = #{month}")
    InventoryAccount selectBySku(@Param("skuId") String skuId,@Param("year") int year,@Param("month") int month);

    @Select("select top 1 * from tb_inventory_account where sku_id = #{skuId} order by account_year desc,account_month desc ")
    InventoryAccount selectAccount(@Param("skuId") String skuId);
}